﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Baidu.Api
{
    public interface IBaiduClient
    {
        /// <summary>
        /// 执行API请求。
        /// </summary>
        /// <typeparam name="T">领域对象</typeparam>
        /// <param name="request">具体的API请求</param>
        /// <returns>领域对象</returns>
        T Execute<T>(IBaiduRequest<T> request) where T : BaiduResponse;

        /// <summary>
        /// 执行API请求。
        /// </summary>
        /// <typeparam name="T">领域对象</typeparam>
        /// <param name="serverUrl">API请求地址</param>
        /// <param name="request">具体的API请求</param>
        /// <returns>领域对象</returns>
        T Execute<T>(string serverUrl, IBaiduRequest<T> request) where T : BaiduResponse;

        /// <summary>
        /// 执行API请求。
        /// </summary>
        /// <typeparam name="T">领域对象</typeparam>
        /// <param name="serverUrl">API请求地址</param>
        /// <param name="request">具体的API请求</param>
        /// <param name="access_token">开发者准入标识</param>
        /// <returns>领域对象</returns>
        T Execute<T>(string serverUrl, IBaiduRequest<T> request, string access_token) where T : BaiduResponse;
    }
}
